package com.yiligi.myserver.mapper;

import com.yiligi.myserver.pojo.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select * from student where studentId = #{studentId}")
    Student selectStudentByStudentId(@Param("studentId")String studentId);

    @Insert("insert into student(studentId,name,username) values(#{studentId},#{name},#{username})")
    int addStudent(Student student);

    List<Student> selectStudentPage(@Param("pageNum")int pageNum,
                                    @Param("pageSize")int pageSize,
                                    @Param("studentId")String studentId,
                                    @Param("name")String name,
                                    @Param("studentClass")String studentClass);

    int selectTotal(@Param("studentId")String studentId, @Param("name")String name, @Param("studentClass")String studentClass);

}
